package com.szh.mysobproject.viewmodel.app

import com.szh.mysobproject.http.ServiceCreator
import com.szh.mysobproject.http.request.api.FishPondApi
import okhttp3.MultipartBody

/**
 * @author : create by  szh
 * @date : 2022/6/24 14:19
 * @desc :摸鱼获取
 */

object FishNetwork {

    private val fishPondApi = ServiceCreator.create<FishPondApi>()

    /**
     * 获取鱼塘标签
     */
    suspend fun loadTopicList() = fishPondApi.loadTopicList()

    /**
     * 获取用户动态
     */
    suspend fun loadUserFishList(userId: String, page: Int) =
        fishPondApi.loadUserFishList(userId, page)

    /**
     * 动态点赞
     */
    suspend fun dynamicLikes(momentId: String) = fishPondApi.dynamicLikes(momentId)

    /**
     * 获取动态详情
     */
    suspend fun loadFishDetailById(momentId: String) = fishPondApi.loadFishDetailById(momentId)

    /**
     * 获取动态评论
     */
    suspend fun getFishCommendListById() {

    }

    /**
     * 发表评论
     */
    suspend fun postComment(momentComment: Map<String, Any?>) =
        fishPondApi.postComment(momentComment)

    /**
     * 回复评论
     */
    suspend fun replyComment(momentComment: Map<String, Any?>) =
        fishPondApi.replyComment(momentComment)

    /**
     * 上传图片
     */
    suspend fun uploadFishImage(part: MultipartBody.Part) = fishPondApi.uploadFishImage(part)

    /**
     * 发布动态
     */
    suspend fun putFish(moment: Map<String, Any?>) = fishPondApi.putFish(moment)
}